<template>
  <div class="container">
    <div class="hero">
      <h2>欢迎来到熊猫社区</h2>
      <p>在这里，您可以了解熊猫保护的最新动态，参与社区讨论，分享您的熊猫故事。</p>
    </div>

    <div class="slider">
      <img src="@/assets/hero-slider.jpg" alt="熊猫社区">
    </div>

    <div class="features">
      <div class="feature-card">
        <div class="feature-icon">
          <img src="@/assets/community-icon.png" alt="社区">
        </div>
        <h3>社区交流</h3>
        <p>加入我们的社区，与其他熊猫爱好者交流分享，参与有趣的讨论。</p>
        <router-link to="/community" class="btn">进入社区</router-link>
      </div>

      <div class="feature-card">
        <div class="feature-icon">
          <img src="@/assets/database-icon.png" alt="资料库">
        </div>
        <h3>熊猫资料库</h3>
        <p>探索丰富的熊猫知识库，了解熊猫的习性、保护现状等信息。</p>
        <router-link to="/database" class="btn">浏览资料</router-link>
      </div>

      <div class="feature-card">
        <div class="feature-icon">
          <img src="@/assets/shop-icon.png" alt="商城">
        </div>
        <h3>熊猫商城</h3>
        <p>购买可爱的熊猫周边产品，支持熊猫保护事业。</p>
        <router-link to="/shop" class="btn">去购物</router-link>
      </div>
    </div>
  </div>
</template>

<style scoped>
:root {
  --primary-color: #333333;
  --secondary-color: #4CAF50;
  --accent-color: #FF9800;
  --light-color: #f8f8f8;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Arial', sans-serif;
}

body {
  background-color: var(--light-color);
  color: var(--primary-color);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.hero {
  padding: 60px 0;
  text-align: center;
}

.hero h2 {
  font-size: 36px;
  margin-bottom: 20px;
  color: var(--primary-color);
}

.hero p {
  font-size: 18px;
  color: #666;
  max-width: 800px;
  margin: 0 auto 30px;
  line-height: 1.6;
}

.slider {
  height: 400px;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 50px;
  position: relative;
}

.slider img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin: 50px 0;
}

.feature-card {
  background-color: white;
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s, box-shadow 0.3s;
  text-align: center;
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.feature-icon {
  width: 80px;
  height: 80px;
  background-color: rgba(76, 175, 80, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.feature-icon img {
  width: 40px;
  height: 40px;
}

.feature-card h3 {
  font-size: 24px;
  margin-bottom: 15px;
  color: var(--primary-color);
}

.feature-card p {
  color: #666;
  margin-bottom: 20px;
  line-height: 1.6;
}

.btn {
  display: inline-block;
  padding: 10px 25px;
  background-color: var(--secondary-color);
  color: white;
  border-radius: 25px;
  text-decoration: none;
  transition: all 0.3s;
}

.btn:hover {
  background-color: #3e8e41;
  transform: translateY(-2px);
}
</style>

<script setup>
import { onMounted } from 'vue'

onMounted(() => {
  console.log('Home 页面已加载')
})
</script> 